package ch.ffhs.links_library.session;

import ch.ffhs.links_library.entities.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("folderList")
public class FolderList extends EntityQuery<Folder> {


	private static final long serialVersionUID = 7015023289621926433L;

	private static final String EJBQL = "select f from Folder f";

	private static final String[] RESTRICTIONS = { "lower(folder.foldername) like lower(concat(#{folderList.folder.foldername},'%'))", };

	private Folder folder = new Folder();

	public FolderList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public Folder getFolder() {
		return folder;
	}
}
